package com.huawei.esdk.tp.domain.model;

import java.util.Date;
import java.util.List;

import com.huawei.esdk.platform.common.SDKResult;
import com.huawei.esdk.platform.common.exception.SDKException;
import com.huawei.esdk.platform.common.utils.ApplicationContextUtil;
import com.huawei.esdk.platform.nemgr.itf.IDeviceManager;
import com.huawei.esdk.tp.common.constants.TPConstant;
import com.huawei.esdk.tp.device.smc.v100r003c10.SMC20V1R3C10IMCUManagerCapability;
import com.huawei.esdk.tp.domain.model.bean.MCUInfoList;
import com.huawei.esdk.tp.domain.model.bean.MCUResourceList;
import com.huawei.esdk.tp.domain.model.bean.QuerySites;

public class MCUConference
{
    private static IDeviceManager deviceManager = (IDeviceManager)ApplicationContextUtil.getBean("deviceManager");
    
    public static IDeviceManager getDeviceManager()
    {
        return deviceManager;
    }
    
    public static void setDeviceManager(IDeviceManager deviceManager)
    {
        MCUConference.deviceManager = deviceManager;
    }
    
    public static SDKResult<MCUInfoList> queryMCUInfoEx(QuerySites querySites) throws SDKException
    {
        SMC20V1R3C10IMCUManagerCapability confMgr =
            deviceManager.getDeviceServiceProxy(TPConstant.DEV_ID_SMC, SMC20V1R3C10IMCUManagerCapability.class);
        return confMgr.queryMCUInfoEx(querySites);
    }

    public static SDKResult<MCUResourceList> queryMCUFutureResourceEx(Integer duration, Date beginTime, List<Integer> mcus)
        throws SDKException
    {
        SMC20V1R3C10IMCUManagerCapability confMgr =
            deviceManager.getDeviceServiceProxy(TPConstant.DEV_ID_SMC, SMC20V1R3C10IMCUManagerCapability.class);
        return confMgr.queryMCUFutureResourceEx(duration, beginTime, mcus);
    }
    
}
